﻿using System;
using System.Collections.ObjectModel;

namespace Web.Base.OrderHandler
{
    public class OrderHandlerManager
    {
        private static OrderHandlerManager current = new DefaultOrderHandlerManager();

        private readonly Collection<IOrderHandler> handlers;

        public Collection<IOrderHandler> Handlers
        {
            get { return handlers; }
        }

        public static OrderHandlerManager Current
        {
            get { return current; }
            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }
                current = value;
            }
        }

        public OrderHandlerManager()
        {
            handlers = new Collection<IOrderHandler>();
        }
    }
}